<?php
$this->breadcrumbs=array(
	'Products'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List Product', 'url'=>array('index')),
	array('label'=>'Manage Product', 'url'=>array('admin')),
);
?>
<script type="text/javascript">
<!--
$(function(){
	$("#product_submit").click(function(){
		$.post('<?php echo $this->createUrl('product/create');?>',{	
//				'Product[pro_id]':$("#Product_pro_id").val(),
				'Product[pro_name]':$("#Product_pro_name").val(),
				'Product[pro_price]':$("#Product_pro_price").val(),
				'Product[pro_cid]':$("#Product_pro_cid").val(),
				'Product[pro_left]':$("#Product_pro_left").val(),
				'Product[pro_sold]':$("#Product_pro_sold").val(),
				'Product[pro_iscomment]':$("#Product_pro_iscomment").val(),
				'Product[pro_status]':$("#Product_pro_status").val(),
				'Product[pro_discount]':$("#Product_pro_discount").val(),
				'Product[pro_describe]':$("#Product_pro_describe").val(),
				'Product[pro_recommend]':$("#Product_pro_recommend").val(),
	
			},function(msg){
//				$(".column2:last").html(msg);
				location.href=msg;
		});
	});

	
});


function func_update(id){
	var object = id.parent().siblings(".thumbnail");
	var src = id.attr("id");

	location.href = src;
//	$.colorbox({iframe:true, width:'90%', height:'90%',href:src,onClosed:function(){ load(); }});
	
}



function func_folder(id){
	var object = id.parent().siblings(".thumbnail");
	var id = object.find("a").attr("id");
	
	var src = object.find("img").attr("src");
	$("#pro_pic_id").attr("src",src);

//	$.get('{$this->createUrl('folder',array('id'=>$_GET['id']))}',{'fid':id},function(msg){
//		if(msg == "ok"){
//			alert("封面设置成功!");
//		}
//		
//	});	
}

function func_show(id){

	var object = id.parent().siblings(".thumbnail");
	var src = object.find("img").attr("src");
	src = src.replace('_thumb','');
	$.colorbox({href:src,slideshow:true, height:500});
	return false;
}

function func_showImg(id){

	var src = id.attr("name");

	$.colorbox({href:src});
	return false;
}

function func_showInfo(id){
	var src = id.attr("name");
	$.colorbox({iframe:true, innerWidth:425, innerHeight:444,href:src});
	return false;
}
//-->
</script>
<div class="column1">
	<div class="box">
		<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Create Product',	));?>
			<div class="box-content">
				<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
			</div>
		<?php $this->endWidget();?>
	</div>	
</div>
<div class="column2">
	<div class="box">
		<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Products Info',	));?>
			<div class="box-content" style="height:550px;">
				<?php $this->widget('zii.widgets.CListView', array(
					'dataProvider'=>$dataProvider,
					'itemView'=>'_pview',
				)); ?>				
			</div>
		<?php $this->endWidget();?>
	</div>
	
</div>

<?php $this->widget('ext.box.colorbox.colorboxWidget',array(
		'id'=>'.various1',
		'theme'=>'example1',
//		'options'=>'width:"50%", inline:true, href:"#uploadbox",onClosed:function(){ load(); }'
));?> 